package com.inspur.ydt.openapi;

import java.io.IOException;
import java.net.UnknownHostException;

import com.inspur.iop.OpenApi;

/**
 * 
 * @author likangkang
 *
 */
public interface OpenApiProvider {
	  /** 
	   *判断连接池内是否有连接 
	   * @return true 有连接返回true,否则返回false 
	   */  
	  boolean isPooled();   
	  
	  /** 
	   * 当此方法被调用的时候提供一个 socket 
	   * @see Socket 
	   * @return Socket a Connection object. 
	   */  
	 OpenApi getConnection();   
	  
	  /** 
	   * 连接池初始化 
	   */  
	  void init() throws UnknownHostException, IOException;   
	  
	  /** 
	   * 连接池重新启动 
	   */  
	  void restart() throws UnknownHostException, IOException;   
	  
	  /** 
	   * 注销连接池 
	   */  
	  void destroy() throws  IOException;  
}
